package com.feidee.data.email.model;


import java.util.ArrayList;
import java.util.List;

public class EmailAddress {

  private String email_key;

  public String getEmail_key() {
    return email_key;
  }

  public void setEmail_key(String email_key) {
    this.email_key = email_key;
  }

  private String scene;

  public String getScene() {
    return scene;
  }

  public void setScene(String scene) {
    this.scene = scene;
  }

  public List<String> bccAddresses;
  public List<String> toAddresses;
  public List<String> ccAddresses;


  public EmailAddress() {
    toAddresses = new ArrayList<String>();
    ccAddresses = new ArrayList<String>();
    bccAddresses = new ArrayList<String>();
  }

  public void put(String type, String address) {
    if ("to".equals(type)) {
      addToAddress(address);
    } else if ("cc".equals(type)) {
      addCcAddress(address);
    } else if ("bcc".equals(type)) {
      addBccAddress(address);
    }
  }

  public void addToAddress(String address) {
    toAddresses.add(address);
  }

  public void addCcAddress(String address) {
    ccAddresses.add(address);
  }

  public void addBccAddress(String address) {
    bccAddresses.add(address);
  }

  public List<String> getBccAddresses() {
    return bccAddresses;
  }

  public List<String> getToAddresses() {
    return toAddresses;
  }

  public List<String> getCcAddresses() {
    return ccAddresses;
  }

  @Override
  public String toString() {
    return "EmailAddress{" +
        "email_key='" + email_key + '\'' +
        ", scene='" + scene + '\'' +
        ", bccAddresses=" + bccAddresses +
        ", toAddresses=" + toAddresses +
        ", ccAddresses=" + ccAddresses +
        '}';
  }
}
